package financial.sharing.center.common.enums;

/**
 * @ClassName ContractDirectionEnum
 * @Description TODO
 * @Author guoyuhang
 * @ @csdn https://blog.csdn.net/qq_40788718
 * @Date 2021/4/5
 * @Version 1.0
 */
public enum ContractDirectionEnum {

    无("无", 0),
    收入合同("收入合同", 1),
    支出合同("支出合同", 2);

    private final String name;
    private final Integer value;

    ContractDirectionEnum(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return this.name;
    }

    public Integer getValue() {
        return this.value;
    }

    public static ContractDirectionEnum name2Enum(String value) {
        for (ContractDirectionEnum enumName : ContractDirectionEnum.values()) {
            if(enumName.getName().equals(value)) {
                return enumName;
            }
        }
        return null;
    }

    public static ContractDirectionEnum int2Enum(Integer value) {
        for (ContractDirectionEnum enumName : ContractDirectionEnum.values()) {
            if(enumName.getValue().equals(value)) {
                return enumName;
            }
        }
        return null;
    }

}
